<?php
/**
 * Pertyler DatabaseManagement
 * View
 * SelectRow
 *
 * @author	Emre Hasegeli <hasegeli@gmail.com>
 * @license	GNU General Public License v3
 */

if(!($Content instanceof \Pert\Page_Content))
	return;
?>
<h4 ><?php echo $Content->TableName; ?>
</h4>

<form action="Table.php?Table=<?php echo $Content->TableId; ?>"
		method="post" >

	<table ><?php
foreach($Content->ReferancedColumnArray AS $columnId => $referancedColumn)
{
?>
		<tr >
			<td >
				<a href="<?php
	if(isset($Content->ReferancedColumnTableIdArray[$columnId]))
	{
?>Table.php?Table=<?php echo $Content->ReferancedColumnTableIdArray[$columnId];
	}
?>" ><?php echo $referancedColumn; ?>
				</a>
			</td>

			<td >
				<select name="<?php echo $columnId; ?>[]"
						multiple="multiple" ><?php
	if(isset($Content->ReferancedColumnValueArrayArray[$columnId]))
		foreach($Content->ReferancedColumnValueArrayArray[$columnId] AS $columnValueId => $referancedColumnValue)
		{
?>

					<option value="<?php echo $columnValueId; ?>"
							selected="selected" ><?php echo $referancedColumnValue; ?>
					</option><?php
		}
?>

				</select>
			</td>
		</tr><?php
}

foreach($Content->StringColumnArray AS $columnId => $stringColumn)
{
?>		<tr >
			<td ><?php echo $stringColumn; ?>
			</td>

			<td >
				<input type="text"
						name="<?php echo $columnId; ?>"<?php
	if(isset($Content->StringColumnValueArray[$columnId]))
	{
?>
						value="<?php echo $Content->StringColumnValueArray[$columnId]; ?>"<?php
	}
?>
						readonly="readonly" />

			</td>
		</tr><?php
}
?>
	</table>

	<p >
		<input type="submit"
				name="Back"
				value="Back" />

	</p>
</form>
